Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next |

Retrieving Window Information

This section describes

FindWindow

Maps the location of the cursor to a part of the screen or a region of a window when your application receives a mouse-down event.

pascal short FindWindow (Point thePoint,
                     WindowPtr *theWindow);
thePoint
The point, in global coordinates, where the mouse-down event occurred. Your application retrieves this information from the where field of the event record.
theWindow
A pointer to the address where FindWindow returns a pointer to the window in which the mouse-down event occurred, if it occurred in a window. If it didn't occur in a window, FindWindow sets the value of the address pointed to by theWindow to nil .

DESCRIPTION

The FindWindow function returns an integer that specifies where the cursor was when the user pressed the mouse button. You typically call FindWindow whenever you receive a mouse-down event. The FindWindow function helps you dispatch the event by reporting whether the cursor was in the menu bar or in a window when the mouse button was pressed and, if it was in a window, which window and which region of the window. If the mouse-down event occurred in a window, FindWindow places a pointer to the window in the value referenced through the parameter theWindow .

The FindWindow function returns an integer that specifies one of nine regions. For a list of the corresponding enumerators and the actions your application should take, see "FindWindow Result Codes" .

FrontWindow

Identifies the active window.

pascal WindowPtr FrontWindow (void);

DESCRIPTION

The FrontWindow function returns a pointer to the first visible window in the window list (that is, the active window). If there are no visible windows, FrontWindow returns nil .

SPECIAL CONSIDERATIONS

The FrontWindow function may move memory. Therefore, you should not use it in a VBL task.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next